package cn.tutu.blockchain.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.github.pagehelper.PageInfo;

import cn.tutu.blockchain.common.MsgObj;
import cn.tutu.blockchain.common.Page;
import cn.tutu.blockchain.eth.entity.EthRecord;
import cn.tutu.blockchain.eth.service.EthRecordService;

@RequestMapping("/ethRecord")
@RestController
public class EthRecordController {

	@Autowired
	private EthRecordService ethRecordService;

	@RequestMapping("/getGridByUser")
	public MsgObj getGridByUser(String userId, Page page) {
		PageInfo<EthRecord> byModel = ethRecordService.getByUserId(userId, page);
		return MsgObj.buildSuccessObj(byModel.getList());
	}

	@RequestMapping("/create")
	public MsgObj create(EthRecord integralRecord) {

		ethRecordService.create(integralRecord);
		return MsgObj.buildSuccessMsg();
	}

}
